#include "main.h"

#include "board.h"
#include "my_lib/cmd_analyse.h"
#include "my_lib/led.h"
#include "my_lib/my_log.h"
// #include "my_lib/rgb.h"
// #include "imulib.h"
// #include "my_lib/pwm.h"
// #include "my_lib/encoder.h"
#include "my_lib/bluetooth.h"


int32_t main(void)
{
    delay1ms(100);
    BoardInit();

    CmdInit();
    LedInit();
    // IMU_Init(&imu_ctx, &imu_input, &imu_euler);
    // RGB_Init();
    // RGB_Test();
    // PwmInit();
    // EncoderInit();
    BlueInit();
    
    printf("\r\nCW32F030 UART Printf Example\r\n");

    // static uint32_t time_tick = 0;
    while (1)
    {
        CmdTask_Handler(20);
        LedTask_Handler(50);
        BlueHandler(20);
        //IMU_Handler(20);
        // if((GetTick()-time_tick) >= 1000){
        //    time_tick = GetTick();
        // //    printf("x:%.1f y:%.1f z:%.1f\r\n", imu_euler.pitch, imu_euler.roll, imu_euler.yaw);
        //     printf("count->%d\r\n", Get_Counter_GTIM3());
        // }
    }
}



/******************************************************************************
 * EOF (not truncated)
 ******************************************************************************/
#ifdef  USE_FULL_ASSERT
/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t *file, uint32_t line)
{
    /* USER CODE BEGIN 6 */
    /* User can add his own implementation to report the file name and line number,
       tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
    /* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

